#include <iostream>

using namespace std;

struct student
{
    char name[10];
    int a, b, c;
    int sum;
};

int main()
{
    int t, index = 0;
    cin >> t;
    student *stu = new student[t];
    int max = 0;
    for (int i = 0; i < t; i++)
    {

        cin >> stu[i].name >> stu[i].a >> stu[i].b >> stu[i].c;
        stu[i].sum = stu[i].a + stu[i].b + stu[i].c;
        if (i == 0)
        {
            max = stu[i].sum;
        }
        if (stu[i].sum > max)
        {
            max = stu[i].sum;
            index = i;
        }
    }
    cout << stu[index].name << " " << stu[index].a << " " << stu[index].b << " " << stu[index].c << endl;
    return 0;
}